package edu.cmu.atlub.model;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import edu.cmu.atlub.persistence.ConnectionManager;

public class MutualFollowModel {
    public static void insertMutualFollow(long userId1, long userId2) throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {
	Connection conn = ConnectionManager.getConnection();
	insertMutualFollow(userId1, userId2, conn);
	conn.close();
    }
    
    public static void insertMutualFollow(long userId1, long userId2, Connection conn) throws SQLException {
	String sqlStr = "INSERT IGNORE INTO mutual_follow (mutual_follow_id, user_id1, user_id2) VALUES (NULL, ?, ?);";
	PreparedStatement stmt = conn.prepareStatement(sqlStr);
	stmt.setLong(1, userId1);
	stmt.setLong(2, userId2);
	stmt.executeUpdate();
    }
}
